package com.niit.apis;

import com.niit.entity.Application;
import com.niit.entity.Job;
import com.niit.entity.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(name = "application-service")
public interface ApplicationFeignApi {

    //添加申请（求职者发起）
    @PostMapping("/api/application/add")
     void addApplication(@RequestBody Application application);

    //更新申请（求职者修改）
    @PutMapping("/api/application/update")
     void updateApplication(@RequestBody Application application);

    //删除申请（求职者与公司管理员删除）
    @DeleteMapping("/api/application/delete/{id}")
     void deleteApplication(@PathVariable("id") int id);

    //获取所有申请
    @GetMapping("/api/application/getAll")
    List<Application> getApplications();

    //获取某个申请
    @GetMapping("/api/application/get/{id}")
     Application getApplicationById(@PathVariable("id") int id);

    //获取某个求职者的申请
    @PostMapping("/api/application/getBySeeker")
     List<Application> getSeekerApplications(@RequestBody User seeker);

    //获取某个职位的申请
    @GetMapping("/api/application/getByJob")
     List<Application> getJobApplications(@RequestBody Job job);
    //根据工作的发布者获取所有的职位申请
    @PostMapping("/api/application/getByCompany")
     List<Application> getCompanyApplications(@RequestBody User user);

    //获取某个职位的申请数量
    @GetMapping("/api/application/getCountByJob")
     long getCountByJob(@RequestBody Job job);
}
